package com.rabbit.produce.controller;

import com.rabbit.produce.entrty.User;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.Date;

@Controller
public class HelloSender2 {
 
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send() {
        String context = "sender object2 " + new Date();
        this.rabbitTemplate.convertAndSend("hello", context);
    }
 
}
